﻿// ================================================================================
//        File: ExceptionManager.cs
//        Desc: Use Log4net to get log
//        Auth: Alex
//        Date: 2010-09-17
// ================================================================================
//        Change History
// ================================================================================
//        Date:         Author:                  Description:
//        --------     --------              -------------------
//              
// ================================================================================

using System.Text;

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4netConfig.xml", Watch = true)]
namespace EShop.Common
{
    public static class log
    {
        private static readonly log4net.ILog logWriter = log4net.LogManager.GetLogger("AppenderLog");
        public static void Write(string logInfo)
        {

            try
            {
                StringBuilder oInfo = new StringBuilder();

                //2.添加其它信息
                //string sVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
                //oInfo.AppendFormat("当前版本: {0}\r\n", sVersion);
                oInfo.AppendFormat("信息描述:{0}\r\n", logInfo);

                logWriter.Error(oInfo.ToString());
            }
            catch
            {
            }
        }
    }
}
